package com.training.java.core.equals;


//String class constructors

public class StringConstructors {

	public static void main(String[] args) {
		
		//declaring a char array and assigning values to charArray;
		//charArray type in in char.
		char[] charArray = {'b','i','r','t','h',' ','d','a','y'};
		//Instantiating object String.
		
		String str = new String("happy");
		
		//use String constructors
		
		String str1 = new String();
		String str2 = new String(str);
		String str3 = new String(charArray);
		// from charArray - taking 3 letters starting from index number 6 
		String str4 = new String(charArray,6,3);
		
		System.out.printf("str1=%s\nstr2=%s\nstr3=%s\nstr4=%s\n", str1,str2,str3,str4);
	}//end main


	}//end class

